home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / MONDATA.H < prev    next >
C/C++ Source or Header  |  1993-03-16  |  5KB  |  96 lines

  1. /*    SCCS Id: @(#)mondata.h    3.0    89/11/21
  2. /* NetHack may be freely redistributed.  See license for details. */
  3. /* Copyright (c) 1989 Mike Threepoint */
  4.  
  5. #ifndef MONDATA_H
  6. #define MONDATA_H
  7.  
  8. # ifndef STUPID_CPP    /* otherwise these macros are functions in mondata.c */
  9.  
  10. #define verysmall(ptr)        ((ptr)->msize < MZ_SMALL)
  11. #define bigmonst(ptr)        ((ptr)->msize >= MZ_LARGE)
  12.  
  13. #define is_flyer(ptr)        (((ptr)->mflags1 & M1_FLY) != 0L)
  14. #define is_floater(ptr)     ((ptr)->mlet == S_EYE)
  15. #define is_swimmer(ptr)     (((ptr)->mflags1 & M1_SWIM) != 0L)
  16. #define passes_walls(ptr)    (((ptr)->mflags1 & M1_WALLWALK) != 0L)
  17. #define amorphous(ptr)        (((ptr)->mflags1 & M1_AMORPHOUS) != 0L)
  18. #define noncorporeal(ptr)    ((ptr)->mlet == S_GHOST)
  19. #define tunnels(ptr)        (((ptr)->mflags1 & M1_TUNNEL) != 0L)
  20. #define needspick(ptr)        (((ptr)->mflags1 & M1_NEEDPICK) != 0L)
  21. #define hides_under(ptr)    (((ptr)->mflags1 & M1_CONCEAL) != 0L)
  22. #define is_hider(ptr)        (((ptr)->mflags1 & M1_HIDE) != 0L)
  23. #define haseyes(ptr)        (((ptr)->mflags1 & M1_NOEYES) == 0L)
  24. #define nohands(ptr)        (((ptr)->mflags1 & M1_NOHANDS) != 0L)
  25. #define nolimbs(ptr)        (((ptr)->mflags1 & M1_NOLIMBS) == M1_NOLIMBS)
  26. #  ifdef POLYSELF
  27. #define polyok(ptr)        (((ptr)->mflags1 & M1_NOPOLY) == 0L)
  28. #  endif
  29. #define is_whirly(ptr)        ((ptr)->mlet == S_VORTEX || (ptr) == &mons[PM_AIR_ELEMENTAL])
  30. #define humanoid(ptr)        (((ptr)->mflags1 & M1_HUMANOID) != 0L)
  31. #define is_animal(ptr)        (((ptr)->mflags1 & M1_ANIMAL) != 0L)
  32. #define slithy(ptr)        (((ptr)->mflags1 & M1_SLITHY) != 0L)
  33. #define thick_skinned(ptr)    (((ptr)->mflags1 & M1_THICK_HIDE) != 0L)
  34. #define resists_fire(ptr)    (((ptr)->mflags1 & M1_FIRE_RES) != 0L)
  35. #define resists_cold(ptr)    (((ptr)->mflags1 & M1_COLD_RES) != 0L)
  36. #define resists_disint(ptr)    ((ptr) == &mons[PM_BLACK_DRAGON] || (ptr) == &mons[PM_BABY_BLACK_DRAGON])
  37. #define resists_elec(ptr)    (((ptr)->mflags1 & M1_ELEC_RES) != 0L)
  38. #define resists_acid(ptr)    (((ptr)->mflags1 & M1_ACID) != 0L)
  39. #define acidic(ptr)        (((ptr)->mflags1 & M1_ACID) != 0L)
  40. #define resists_poison(ptr)    (((ptr)->mflags1 & (M1_POIS | M1_POIS_RES)) != 0L)
  41. #define poisonous(ptr)        (((ptr)->mflags1 & M1_POIS) != 0L)
  42. #define regenerates(ptr)    (((ptr)->mflags1 & M1_REGEN) != 0L)
  43. #define perceives(ptr)        (((ptr)->mflags1 & M1_SEE_INVIS) != 0L)
  44. #define can_teleport(ptr)    (((ptr)->mflags1 & M1_TPORT) != 0L)
  45. #define control_teleport(ptr)    (((ptr)->mflags1 & M1_TPORT_CONTROL) != 0L)
  46. #define is_armed(ptr)        attacktype(ptr, AT_WEAP)
  47. #define likes_gold(ptr)     (((ptr)->mflags1 & M1_GREEDY) != 0L)
  48. #define likes_gems(ptr)     (((ptr)->mflags1 & M1_JEWELS) != 0L)
  49. #define likes_objs(ptr)     (((ptr)->mflags1 & M1_COLLECT) != 0L || \
  50.                     is_armed(ptr))
  51. #define likes_magic(ptr)    (((ptr)->mflags1 & M1_MAGIC) != 0L)
  52. #define is_undead(ptr)        (((ptr)->mflags2 & M2_UNDEAD) != 0L)
  53. #define resists_sleep(ptr)    (((ptr)->mflags1 & M1_SLEE_RES) != 0L || is_undead(ptr))
  54. #define is_were(ptr)        (((ptr)->mflags2 & M2_WERE) != 0L)
  55. #define is_elf(ptr)        (((ptr)->mflags2 & M2_ELF) != 0L)
  56. #define is_dwarf(ptr)        (((ptr)->mflags2 & M2_DWARF) != 0L)
  57. #define is_giant(ptr)        (((ptr)->mflags2 & M2_GIANT) != 0L)
  58. #  ifdef GOLEMS
  59. #define is_golem(ptr)        ((ptr)->mlet == S_GOLEM)
  60. #  endif
  61. #define is_domestic(ptr)    (((ptr)->mflags2 & M2_DOMESTIC) != 0L)
  62. #define is_orc(ptr)        (((ptr)->mflags2 & M2_ORC) != 0L)
  63. #define is_human(ptr)        (((ptr)->mflags2 & M2_HUMAN) != 0L)
  64. #define is_demon(ptr)        (((ptr)->mflags2 & M2_DEMON) != 0L)
  65. #define is_mercenary(ptr)    (((ptr)->mflags2 & M2_MERC) != 0L)
  66. #define is_wanderer(ptr)    (((ptr)->mflags2 & M2_WANDER) != 0L)
  67. #define always_hostile(ptr)    (((ptr)->mflags2 & M2_HOSTILE) != 0L)
  68. #define always_peaceful(ptr)    (((ptr)->mflags2 & M2_PEACEFUL) != 0L)
  69. #define extra_nasty(ptr)    (((ptr)->mflags2 & M2_NASTY) != 0L)
  70. #define strongmonst(ptr)    (((ptr)->mflags2 & M2_STRONG) != 0L)
  71. #  ifdef POLYSELF
  72. #define can_breathe(ptr)    attacktype(ptr, AT_BREA)
  73. #define cantwield(ptr)        (nohands(ptr) || verysmall(ptr))
  74. #define cantweararm(ptr)    (breakarm(ptr) || sliparm(ptr))
  75. #  endif /* POLYSELF */
  76. #define carnivorous(ptr)    (((ptr)->mflags2 & M2_CARNIVORE) != 0L)
  77. #define herbivorous(ptr)    (((ptr)->mflags2 & M2_HERBIVORE) != 0L)
  78. #define metallivorous(ptr)    (((ptr)->mflags2 & M2_METALLIVORE) != 0L)
  79. #define lays_eggs(ptr)        (((ptr)->mflags2 & M2_EGGS) != 0L)
  80. #define throws_rocks(ptr)    (((ptr)->mflags2 & M2_ROCKTHROW) != 0L)
  81. #define type_is_pname(ptr)    (((ptr)->mflags2 & M2_PNAME) != 0L)
  82. #define is_lord(ptr)        (((ptr)->mflags2 & M2_LORD) != 0L)
  83. #define is_prince(ptr)        (((ptr)->mflags2 & M2_PRINCE) != 0L)
  84. #  ifdef INFERNO
  85. #define is_ndemon(ptr)        (is_demon(ptr) && \
  86.             (((ptr)->mflags2 & (M2_LORD | M2_PRINCE)) == 0L))
  87. #  else
  88. #define is_ndemon(ptr)        (ptr == &mons[PM_DEMON])
  89. #  endif
  90. #define is_dlord(ptr)        (is_demon(ptr) && is_lord(ptr))
  91. #define is_dprince(ptr)        (is_demon(ptr) && is_prince(ptr))
  92.  
  93. # endif /* STUPID_CPP */
  94.  
  95. #endif /* MONDATA_H */
  96.